package cn.siat.gene.domain;

import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import lombok.experimental.Accessors;
import org.apache.commons.lang3.StringUtils;

import java.util.Date;
import java.util.Objects;

@Data
@Accessors(chain = true)
public class SequenceOperate {
    private Long sequenceId;
    private Long id;
    private Integer start;
    private Integer end;
    private Integer order;
    private String preSequence;
    private String sequence;
    private String sequenceName;
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone ="GMT+8")
    private Date createTime;
    private String createBy;
    private String createByName;
    private String type;
    public String getType(){
        if(StringUtils.isNotEmpty(type)){
            return type.toUpperCase();
        }
        return type;
    }
    private Boolean needSetPreSequence;
    private Boolean canRollback;
    /**删除标记*/
    private Integer isDel;
    private String designId;

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        SequenceOperate that = (SequenceOperate) o;
        return Objects.equals(id, that.id);
    }

    @Override
    public int hashCode() {
        return Objects.hash(id);
    }
}
